<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
    <div class="box">
        <input type="text" v-model="xing"><br><br>
        <input type="text" v-model="ming"><br><br>
        <!-- slice 截取方法,只要第0,1,2个,后面的都不要 -->
        <span>{{fullName()}}</span>
    </div>
</body>
<script>
    var vm = new Vue({
        data() {
            return {
                xing:'张',
                ming:'三',
                
            }
        },
        methods: {
            fullName(){
                return this.xing+'-'+this.ming
            },
        },
    })
    vm.$mount('.box')
</script>
</html>